
package com.zhitan.ems.app.patrol.wrapper;
import org.springframework.beans.factory.annotation.Value;

import com.zhitan.ems.app.patrol.entity.PatrolPointEntity;
import com.zhitan.ems.app.patrol.vo.PatrolPointVO;
import com.zhitan.ems.common.extra.utils.BeanUtil;
import com.zhitan.ems.framework.core.mp.base.BaseEntityWrapper;

  /**
 * 巡检点 包装类,返回视图层所需的字段
 * @author zhitan
 * 
 * @date 2024-12-03 23:16:33
 */
public class PatrolPointWrapper extends BaseEntityWrapper<PatrolPointEntity, PatrolPointVO>  {
	@Value("${app.showQrUrl}")
	public static String showQrUrl;
    public static PatrolPointWrapper build() {
        return new PatrolPointWrapper();
    }
	@Override
	public PatrolPointVO entityVO(PatrolPointEntity patrolPoint) {
		if(patrolPoint==null) {
			return null;
		}
		PatrolPointVO patrolPointVO = BeanUtil.copy(patrolPoint, PatrolPointVO.class);
		if(showQrUrl!=null&&patrolPoint.getQrCode()!=null) {
			patrolPointVO.setShowQrUrl(showQrUrl+"/api/showQr?qrCode="+patrolPoint.getQrCode());
		}
		return patrolPointVO;
	}

}
